package info.webest.media;

import android.app.Activity;
import android.appwidget.AppWidgetManager;
import android.content.Intent;
import android.os.Bundle;
import android.widget.RemoteViews;


public class WidgetConfigure extends Activity  {


	private int mAppWidgetId;
		
	public WidgetConfigure() {

		Intent intent = getIntent();
		Bundle extras = intent.getExtras();
		if (extras != null) {
			mAppWidgetId = extras.getInt(AppWidgetManager.EXTRA_APPWIDGET_ID,
					AppWidgetManager.INVALID_APPWIDGET_ID);
		}


		// 2. Perform your App Widget configuration.
		// 3. When the configuration is complete, get an instance of the
		// AppWidgetManager by calling getInstance(Context):

		AppWidgetManager appWidgetManager = AppWidgetManager
				.getInstance(this);

		// 4. Update the App Widget with a RemoteViews layout by calling
		// updateAppWidget(int, RemoteViews):

		RemoteViews views = new RemoteViews(this.getPackageName(),
				R.layout.widget_layout);
		appWidgetManager.updateAppWidget(mAppWidgetId, views);

		// 5. Finally, create the return Intent, set it with the Activity
		// result, and finish the Activity:

		Intent resultValue = new Intent();
		resultValue.putExtra(AppWidgetManager.EXTRA_APPWIDGET_ID, mAppWidgetId);
		setResult(RESULT_OK, resultValue);
		finish();
		
	}


}
